package com.zlm.mybatisx.mapper;

import com.zlm.mybatisx.pojo.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author DELL
 * @description 针对表【user】的数据库操作Mapper
 * @createDate 2022-09-02 17:24:32
 * @Entity com.zlm.mybatisx.pojo.User
 */
public interface UserMapper extends BaseMapper<User> {

    int insertSelective(User user);

    int deleteByIdAndUserName(@Param("id") Long id, @Param("userName") String userName);

    //    根据id修改年龄和性别
    int updateAgeAndSexById(@Param("age") Integer age, @Param("sex") Integer sex, @Param("id") Long id);

    // 根据年龄的区间来实现的
    List<User> selectAgeAndSexByAgeBetween(@Param("beginAge") Integer beginAge, @Param("endAge") Integer endAge);


    List<User> selectAllOrderByAgeDesc();
}





